import 'package:t3_map/t3_map_plugin/map/core/t3_text_option.dart';

/// 气泡描述
class T3BubbleOptions {
  final Map<String, T3TextOption> texts;
  final T3BubbleType bubbleType;
  final bool showArrow;

  T3BubbleOptions({
    required this.texts,
    required this.bubbleType,
    required this.showArrow
  });

  Map<String, dynamic> toJson() {
    Map<String, Map<String, dynamic>> textsJson = {};
    texts.forEach((key, value) {
      textsJson[key] = value.toJson();
    });
    return {
      'texts' : textsJson,
      'bubbleType' : bubbleType.name,
      'showArrow':showArrow
    };
  }
}

/// 气泡中内容的展示结构
enum T3BubbleType {
  /// 单文本
  singleText,
  /// 预估
  valuation,
  /// 去接乘客
  pickupPassenger,
  /// 等待乘客上车
  waitPassenger,
  /// 乘客已上车，去目的地
  passengerOnBoard
}


